package service

import (
	"encoding/json"
	"github.com/gin-gonic/gin"
	"kubequant/apps/cta"
	"net/http"
)

// GetCtaStrategyGroups 获取cta策略的所有策略组
func GetCtaStrategyGroups(c *gin.Context) {
	engine, err := mainEngine.GetEngine("cta")
	if err != nil {
		c.JSON(http.StatusBadRequest, gin.H{"msg": err.Error()})
		return
	}
	ctaEngine := engine.(*cta.Engine)
	strategyGroupsByte, _ := json.Marshal(ctaEngine.StrategyGroups)
	c.JSON(http.StatusOK, string(strategyGroupsByte))
}
